import { lazy } from "react";
import {
  DesktopOutlined,
  FileOutlined,
  PieChartOutlined,
  TeamOutlined,
  SearchOutlined,
  SyncOutlined,
  BellOutlined,

  ShopOutlined,
  UserOutlined,
  BarsOutlined,
  InstagramOutlined,

  TwitchOutlined,
  SettingOutlined,
} from '@ant-design/icons';


export const RouterChildren = [
  {
    id: '5',
    path: '/home/index',
    title: '首页',
    icon: 'TeamOutlined',
    element: lazy(() => import('../pages/index')),
  },
  // 可视化大屏
  {
    id: '6',
    path: '/home/management',
    title: '智慧大屏',
    icon: 'SearchOutlined',
    element: lazy(() => import('../pages/management/index')),
    children: [
      {
        id: '6-1',
        title: '就业态势',
        icon: 'ShopOutlined',
        path: '/home/management/employment',
        element: lazy(() => import('../pages/management/Employment/employment')),
      },
      {
        id: '6-2',
        title: '设备运维',
        icon: 'UserOutlined',
        path: '/home/management/equipment',
        element: lazy(() => import('../pages/management/Equipment/equipment'))
      },
      {
        id: '6-3',
        title: '智能检测',
        icon: 'BarsOutlined',
        path: '/home/management/intelligent',
        element: lazy(() => import('../pages/management/Intelligent/intelligent'))
      },
      {
        id: '6-4',
        title: '安防管理',
        icon: 'InstagramOutlined',
        path: '/home/management/security',
        element: lazy(() => import('../pages/management/Security/security'))
      }
    ]
  },
  // RBAC
  {
    id: '7',
    path: '/home/rbac',
    title: 'RBAC',
    icon: 'SyncOutlined',
    element: lazy(() => import('../pages/rbac/index')),
    children: [
      {
        id: '7-1',
        path: '/home/rbac/list',
        title: '列表',
        icon: 'SearchOutlined',
        element: lazy(() => import('../pages/rbac/list/list'))
      },
      {
        id: '7-2',
        path: '/home/rbac/add',
        title: '添加',
        icon: 'UserOutlined',
        element: lazy(() => import('../pages/rbac/add/add'))
      },
      {
        id: '7-3',
        path: '/home/rbac/edit',
        title: '修改',
        icon: 'BarsOutlined',
        element: lazy(() => import('../pages/rbac/edit/edit'))
      },
      {
        id: '7-4',
        path: '/home/rbac/del',
        title: '删除',
        icon: 'InstagramOutlined',
        element: lazy(() => import('../pages/rbac/del/del'))
      }
    ]
  },
  // Table
  {
    id: '8',
    path: '/home/table',
    title: 'Table',
    icon: 'BellOutlined',
    element: lazy(() => import('../pages/table/index')),
    children: [
      {
        id: '8-1',
        path: '/home/table/list',
        title: '列表',
        icon: 'SearchOutlined',
        element: lazy(() => import('../pages/table/list/list'))
      },
      {
        id: '8-2',
        path: '/home/table/add',
        title: '添加',
        icon: 'UserOutlined',
        element: lazy(() => import('../pages/table/add/add'))
      },
      {
        id: '8-3',
        path: '/home/table/edit',
        title: '修改',
        icon: 'BarsOutlined',
        element: lazy(() => import('../pages/table/edit/edit'))
      },
      {
        id: '8-4',
        path: '/home/table/del',
        title: '删除',
        icon: 'InstagramOutlined',
        element: lazy(() => import('../pages/table/del/del'))
      }
    ]
  }
]

export const router = {
  mode: 'history',
  routerList: [
    {
      id: '1',
      path: '/',
      to: '/login'
    },

    {
      id: '2',
      path: '/home',
      title: '主页',
      icon: 'DesktopOutlined',
      element: lazy(() => import('../pages/home')),
      children: RouterChildren
    },
    {
      id: '3',
      path: '/welcome',
      title: '欢迎',
      icon: 'FileOutlined',
      element: lazy(() => import('../pages/Welcome/welcome'))
    },
    {
      id: '4',
      path: '/login',
      title: '登录',
      icon: 'PieChartOutlined',
      element: lazy(() => import('../pages/login'))
    }

  ]
}